package cn.wolfcode.luowowo.member.service;


import cn.wolfcode.luowowo.common.exception.LogicException;
import cn.wolfcode.luowowo.member.domain.Fans;
import cn.wolfcode.luowowo.member.domain.UserInfo;

import java.util.List;

/**
 * Created by admin on 2019/8/7.
 */
public interface IUserInfoService {

    /**
     * 验证电话号码是否已经存在
     *
     * @param phone
     * @return
     */
    boolean selectCountByPhone(String phone);

    /**
     * 发送验证码
     *
     * @param phone
     */
    void sendVerifyCode(String phone);

    /**
     * 用户注册
     *
     * @param phone
     * @param nickname
     * @param password
     * @param rpassword
     * @param verifyCode
     * @throws LogicException
     */
    void userRegist(String phone, String nickname, String password, String rpassword, String verifyCode) throws LogicException;

    /**
     * 用户登录
     *
     * @param username
     * @param password
     * @return
     */
    String userLogin(String username, String password) throws LogicException;

    /**
     * 查询所有用户
     *
     * @return
     */
    List<UserInfo> list();

    void update(UserInfo user);

    List<Fans> listByUserId(Long id);

    List<UserInfo> listByFansId(long id);

    void updateHeadImgUrl(String headImgUrl, Long id);

    UserInfo get(Long id);

    UserInfo checkPhoneNum(String phone, String oldpassword);

    void updatePassword(Long id, String newpassword);

    void updateEmail(Long id, String email);

    void updatePhone(Long id, String newPhone);

    List<UserInfo> state(int state);
}
